﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using WmsApp.Service;
using WmsApp.StaticData.Unity;
using WmsApp.WindowControl;
using WmsApp.WmsService;

namespace WmsApp.Window
{
    public partial class FormInStoreBillSelector : DevExpress.XtraEditors.XtraForm,ICanClosing
    {
        public FormInStoreBillSelector()
        {
            InitializeComponent();
        }

        public InStoreBill FInStoreBill { get; private set; }

        private void RepositoryItemButtonEditSelectButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            this.FInStoreBill = (InStoreBill) this.gridView1.GetRow(this.gridView1.FocusedRowHandle);
            this.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void CmdQuery_Click(object sender, EventArgs e)
        {
            IEntityService<InStoreBill, InStoreBillService> service =
             EntityServiceFactory.GetEntityService<InStoreBill, InStoreBillService>();
            this.gridControlEdit1.DataSource = service.GetEntityList(String.Format(" and ExtVarChar2 <> '{0}'",Constant.HasPayApplyBill));
        }
    }
}